# =====================================================================
# 
#   File:        makefile
# 
# ---------------------------------------------------------------------

# This file is part of the Microsoft MSDN Code Samples.

#   Copyright (C) Microsoft Corporation 2002.  All rights reserved.

# This source code is intended only as a supplement to Microsoft
# Development Tools and/or on-line documentation.  See these other
# materials for detailed information regarding Microsoft code samples.

# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
# KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
# PARTICULAR PURPOSE.

# =====================================================================*/

!IFNDEF MICROSOFTSAMPLESSECURITYSSPIPATH
!ERROR Env Variable MICROSOFTSAMPLESSECURITYSSPIPATH must be defined: Parent directory of Microsoft.Samples.Security.SSPI Build Tree
!ENDIF

!include $(MICROSOFTSAMPLESSECURITYSSPIPATH)\master.mak


#--------------------------------------------------
_OUTDIR=$(MICROSOFTSAMPLESSECURITYSSPIPATH)\bin
TARGETS  = $(_OUTDIR)\Microsoft.Samples.Security.SSPI.dll
SOURCES = ..\AssemblyAttributes\AssemblyAttributes.cpp AssemblyInfo.cpp Stdafx.cpp SSPI.cpp Exception.cpp
OBJS = AssemblyAttributes.obj AssemblyInfo.obj Stdafx.obj SSPI.obj Exception.obj
CLEANUP = *.exe *.dll *.pdb
#--------------------------------------------------

_LIBS = msvcrt.lib Secur32.lib

#--------------------------------------------------

all : $(TARGETS) SSPI.reg
	rem Project $(MAKEDIR)

SSPI.reg:
	$(_GACUTIL) /i $(_OUTDIR)\Microsoft.Samples.Security.SSPI.dll

$(TARGETS): $(SOURCES)
	if not exist $(_OUTDIR) md $(_OUTDIR)
	$(_CL) $(_CL_DLL_FLAGS) $(SOURCES)
	$(_LINK) $(_LINK_DLL_FLAGS) /OUT:$(TARGETS) /PDB:$(_OUTDIR)\Microsoft.Samples.Security.SSPI.pdb $(_LIBS) $(OBJS)


clean :
	@if exist $(_OUTDIR) $(_RMDIR) $(_OUTDIR)
	@if exist *.pdb @del /Q *.pdb
	@if exist *.obj @del /Q *.obj
	$(_GACUTIL) /u Microsoft.Samples.Security.SSPI


